import React from 'react'
import { HashRouter as Router, Route, Switch } from 'react-router-dom'
import PageWithNav from 'views/msite/PageWithNav'
import { Provider } from 'mobx-react'
import Login from 'views/msite/Login'
import Article from 'views/msite/Article'
import ArticleList from 'views/msite/ArticleList'
import Detail from 'views/product/Detail'
import GeneralList from 'views/msite/GeneralList'
import * as stores from './store'

function App() {
  return (
    <Provider {...stores}>
      <Router>
        <Switch>
          <Route path="/login" component={Login} />
          <Route path="/detail" component={Detail} />
          <Route path="/articleList/:gid" component={ArticleList} />
          <Route path="/generalList/:gid" component={GeneralList} />
          <Route path="/article/:id" component={Article} />
          <Route path="/" component={PageWithNav} />
        </Switch>
      </Router>
    </Provider>
  )
}

export default App
